home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 10738 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.5 KB

  1. Path: hickory.westol.com!news
  2. From: Mark Kintigh <breetai@oak.westol.com>
  3. Newsgroups: comp.lang.c
  4. Subject: Re: writing graphics to a file
  5. Date: Tue, 19 Mar 1996 09:55:20 -0800
  6. Organization: Westmoreland Online Inc.
  7. Message-ID: <314EF508.176A@oak.westol.com>
  8. References: <4iimo0$c6k@goanna.cs.rmit.EDU.AU>
  9. NNTP-Posting-Host: pm116.westol.com
  10. Mime-Version: 1.0
  11. Content-Type: text/plain; charset=us-ascii
  12. Content-Transfer-Encoding: 7bit
  13. X-Mailer: Mozilla 2.0 (Win16; I)
  14.  
  15. Vincent Anthony Nativo wrote:
  16. > I am just getting used to the C language and have a question. In Turbo C
  17. > for DOS, you can store graphics in void data items using the getimage
  18. > command.  What is the best method for writing this data item to a file,
  19. > and reading it back into the data item so that it can be displayed using
  20. > the putimage command.
  21.  
  22. The most basic method is dumping the memory directly to disk as a binary file.
  23. Just open a binary file, move x bytes from the void * to the disk and, tada!
  24. the graphic is saved (although not very efficently). :)  To load it, just read
  25. in the binary file.  (This is how I started playing with graphics.)
  26. -- 
  27.      _____
  28.     /    /##                 breetai@oak.westol.com
  29.    /    /####                                                     ____
  30.   (| []/ o ##)    "We met the enemy, and they were'nt us, then   | _|||
  31. |\ \_/ /\   # /|  we faced a pannel of 'us' and found they were  ||  ||
  32. | \-\ ==== /-/ |                    the enemy."                   \\//
  33. ||\\ '----' //||                                                   \/
  34. || \\/    \// ||
  35.